package com.alili_tv.system.service.impl;

import com.alili_tv.system.entity.Bullet;
import com.alili_tv.system.mapper.BulletMapper;
import com.alili_tv.system.service.BulletService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 弹幕表 服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2023-03-17
 */
@Service
public class BulletServiceImpl extends ServiceImpl<BulletMapper, Bullet> implements BulletService {

    @Override
    public Long countByVideoId(Long id) {
        LambdaQueryWrapper<Bullet> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Bullet::getVideoId, id);
        return this.count(queryWrapper);
    }
}
